test(oracle): compare resolveOracleClientLocation home with separators neutralized - #1570
Open
hidekoji wants to merge 1 commit into
Open
test(oracle): compare resolveOracleClientLocation home with separators neutralized#1570hidekoji wants to merge 1 commit into
hidekoji wants to merge 1 commit into
Conversation
…s neutralized The Windows daily test failed on test_system.R:1287: Expected 'resolved$home' to equal 'homeLayout'. x[1]: "C:/Users/.../file18b41bfa68e1/client64" y[1]: "C:\\Users\\...\\file18b41bfa68e1/client64" Test-only bug, not a production one. On Windows tempfile() returns backslashes, file.path() appends with a forward slash, so homeLayout is a MIXED-separator string. resolveOracleClientLocation derives home via dirname(), and dirname() on Windows rewrites every separator to a forward slash -- so the two strings describe the same directory but can never be identical() there. Mac/Linux never see it because tempfile() already returns forward slashes. Compare with the separators neutralized instead (a no-op on Mac/Linux). The assertion still pins that home is the parent of the lib directory -- the zip layout's home == "" case and the libDir assertion are untouched. Verified on the Windows daily-test box (exp-test1) against the installed package: identical() is FALSE pre-fix and TRUE post-fix; full test_system.R still passes on Mac ARM. No DESCRIPTION bump: tests only, no shipped R code change, so no rebuilt binaries are required. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
kei51e
approved these changes
Jul 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the single R-package test failure in the 2026-07-29 Windows daily run:
This is a test bug, not a production bug — the two strings name the same directory and differ only in separator style.
Root cause
Windows-only path-separator mismatch, introduced with the Oracle (OCI) work in #1567:
tempfile()on Windows returns backslashes (C:\Users\...\file18b4...).file.path()appends with a forward slash, so the test'shomeLayoutis a mixed-separator string:C:\Users\...\file18b4.../client64.resolveOracleClientLocation()deriveshomeviadirname(libDir), anddirname()on Windows rewrites every separator to a forward slash — so it returnsC:/Users/.../client64.The two can therefore never be
identical()on Windows. Mac/Linux never see it becausetempfile()already returns forward slashes there, sodirname()changes nothing.Verified live on the Windows daily-test box (
exp-test1) against the installed package:Production is unaffected:
homeonly ever feedsSys.setenv(ORACLE_HOME=)on non-Windows (the Windows branch ofapplyOracleClientEnvprependslibDirtoPATHand never readshome), and forward slashes are valid on Windows regardless.Fix
Compare
resolved$homewith the separators neutralized instead of against the rawhomeLayoutstring — a no-op on Mac/Linux. The assertion still pins thathomeis the parent of thelibdirectory; the zip-layouthome == ""case and thelibDirassertion are untouched, so the test keeps its original meaning.Same class as tam's existing
r-file-path-separatorlesson (assert against the production transformation, not a hardcoded separator style), recurring here on the R side.No
DESCRIPTIONversion bump — tests only, no shipped R code change, so no rebuilt per-platform binaries are required.Test plan
exp-test1(Windows, R 4.6.1,exploratory16.0.24) that the assertion isFALSEpre-fix andTRUEpost-fix against the realresolveOracleClientLocation.tests/testthat/test_system.Rstill passes on Mac ARM (no new failures; only the pre-existing unrelated skip/warnings).🤖 Generated with Claude Code